<%@ include file="/html/bjp/seekersprofile/init.jsp" %>
<%@ page import="com.bjp.seekersprofile.service.persistence.QualificationPersistence" %>
<%@ page import="com.bjp.seekersprofile.model.Qualification" %>
<%
	Qualification qualification = null;
	long userId = PortalUtil.getUserId(request);
	Profile profile = (Profile) request.getAttribute("PROFILE");
	List qualifications = null;
	
	
	
	String back_url = (String)ps.getAttribute("back_url");

	qualification = (Qualification) request.getAttribute("QUALIFICATION");
	
	Date dob = profile.getDateOfBirth();
	Date now = new Date();	
	long diff = now.getTime() - dob.getTime();
	int months = (int) (diff / (1000*60*60*24));		
	int years = (int)(months / 365.25);
	int mnths = months -(years*12);		
	String age = years + " Years";
%>
<liferay-ui:tabs
	names="View"
	value="View"
	backURL="<%=back_url %>"/>

<head>
<style type="text/css">
pre {
 white-space: pre-wrap;       /* css-3 */
 white-space: -moz-pre-wrap !important;  /* Mozilla, since 1999 */
 white-space: -pre-wrap;      /* Opera 4-6 */
 white-space: -o-pre-wrap;    /* Opera 7 */
 word-wrap: break-word;       /* Internet Explorer 5.5+ */
 width: 99%;   /* remove horizontal scroll-bar when viewing in IE7 */
}
</style>
<script type="text/javascript">
jQuery(document).ready(function(){
	jQuery("#tabs").tabs();
});
function caller(url,tabVal) {
  
	Liferay.Portal.Tabs.show('<portlet:namespace/>tabs1', ['personal','professional','employee','resume'], tabVal);
	if(tabVal == "personal") {
		jQuery('#personal').show();
		jQuery('#professional').hide();
		jQuery('#employee').hide();
		jQuery('#resume').hide();
	} else if(tabVal == "professional") {
		jQuery('#professional').show();
		jQuery('#personal').hide();
		jQuery('#employee').hide();
		jQuery('#resume').hide();
	} else if(tabVal == "employee") {
		jQuery('#employee').show();
		jQuery('#professional').hide();
		jQuery('#personal').hide();
		jQuery('#resume').hide();
	}else if(tabVal == "resume"){
		jQuery('#resume').show();
		jQuery('#personal').hide();
		jQuery('#professional').hide();
		jQuery('#employee').hide();
	}
}
</script>
</head>
<liferay-ui:tabs
	names="personal,professional,employee,resume"
	onClick="caller"
/>

<c:choose>
	<c:when test="<%= profile != null %>">
	    
	    <div id="personal">
			<table width="100%" class="bjp-table">
			
				<tr class="results-header">
					<td colspan='3''>Personal Details</td>
				</tr>
				<tr>
			  		<td width="48%" colspan="3">
			  			<table width="98%">
				  			<tr>
					  			<td>
					  				<img src="<%= themeDisplay.getPathMain()%>/ext/reports/image?imageId=<%=profile.getPhoto()%>&compressed=true&size=small" />
					  			</td>
				  			</tr>				
				       </table>
					</td>
					
			     </tr>
     
				<tr class="portlet-section-body results-row">
					<td width="30%">
						First Name:
					</td>
					<td width="30%">
						<%=profile.getFirstName() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row alt">
					<td width="30%">
						Last Name:
					</td>
					<td width="30%">
						<%=profile.getLastName() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row">
					<td width="30%">
						Gender:
					</td>
					<td width="30%">
						<c:choose>
							<c:when test="<%=profile.getGender() %>">Male</c:when>
							<c:otherwise>Female</c:otherwise>
						</c:choose>
					</td>
				</tr>
				<tr class="portlet-section-body results-row alt">
					<td width="30%">
						Mobile:
					</td>
					<td width="30%">
						<%=profile.getMobile() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row">
					<td width="30%">
						Home Phone:
					</td>
					<td width="30%">
						<%=profile.getHomePhone() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row alt">
					<td width="30%">
						Age:
					</td>
					<td width="30%">
						<%=age %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row">
					<td width="30%">
						Address:
					</td>
					<td width="30%">
						<%=profile.getAddress() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row alt">
					<td width="30%">
						Email:
					</td>
					<td width="30%">
						<%= profile.getEmailAddress() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row">
					<td width="30%">
						Current Location:
					</td>
					<td width="30%">
						<%= profile.getCurrentLocation() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row alt">
					<td width="30%">
						Job Location:
					</td>
					<td width="30%">
						<%=profile.getJobLocation() %>
					</td>
				</tr>
			</table>
		</div>
		<div id="professional" style='display:none'>
			<table width="100%">
				<tr class="results-header">
					<td colspan='3''>Profession Details</td>
				</tr>
				<tr class="portlet-section-body results-row">
					<td width="30%">
						Experience:
					</td>
					<td width="30%">
						<%= profile.getTotalExperience() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row alt">
					<td width="30%">
						Job Category:
					</td>
					<td width="30%">
						<%=profile.getJobCategory() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row">
					<td width="30%">
						Key Skills:
					</td>
					<td width="30%">
						<%=profile.getKeySkills() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row alt">
					<td width="30%">
						Highest Qualification:
					</td>
					<td width="30%">
						<%=profile.getHighestQualification() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row">
					<td width="30%">
						Specialization:
					</td>
					<td width="30%">
						<%=profile.getSpecialization() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row alt">
					<td width="30%">
						Institute / University:
					</td>
					<td width="30%">
						<%=profile.getInstitute() %>
					</td>
				</tr>
			</table>
		</div>
		<div id="employee" style='display:none'>
		<c:if test="<%= qualification != null %>">
			<table width="100%">
				<tr class="results-header">
					<td colspan='3''>Employee Details</td>
				</tr>
				<tr class="portlet-section-body results-row">
					<td width="30%">
						Course Name:
					</td>
					<td width="30%">
						<%= qualification.getCourseName() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row alt">
					<td width="30%">
						University:
					</td>
					<td width="30%">
						<%= qualification.getUniversity() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row">
					<td width="30%">
						Course Year:
					</td>
					<td width="30%">
						<%= qualification.getCourseYear() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row alt">
					<td width="30%">
						Course Type:
					</td>
					<td width="30%">
						<%= qualification.getRegular() %>
					</td>
				</tr>
				<tr class="portlet-section-body results-row">
					<td width="30%">
						Job Profile:
					</td>
					<td width="30%">

					</td>
				</tr>
			</table>
		</c:if>
		</div>
		<div id="resume" style='display:none'>
			<table width="100%">
				<tr class="results-header">
					<td colspan='3''>Resume Details</td>
				</tr>
				<tr class="portlet-section-body results-row">
					
					<td width="30%">
						 <pre><%= profile.getUp_resume() %></pre>
					</td>
				</tr>				
			</table>
		</div>
	</c:when>
	<c:otherwise>
		Add the profile to search for the job!!!
	</c:otherwise>
</c:choose>
